/* 威胁情报中心-情报源管理样式 */

/* 基础样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background-color: #f8fafc;
  color: #334155;
  line-height: 1.6;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* 网格背景图案 */
body {
  background-image: 
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* 卡片样式 */
.card {
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.04);
}

/* 玻璃态效果 */
.glass {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* 按钮样式 */
.btn {
  transition: all 0.3s ease;
  border-radius: 8px;
  font-weight: 500;
  padding: 0.5rem 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary {
  background-color: #3b82f6;
  color: white;
}

.btn-primary:hover {
  background-color: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.2);
}

.btn-secondary {
  background-color: #64748b;
  color: white;
}

.btn-secondary:hover {
  background-color: #475569;
}

/* 输入框样式 */
.input {
  background-color: rgba(255, 255, 255, 0.8);
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  transition: all 0.3s ease;
}

.input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 标签样式 */
.tag {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
}

.tag-success {
  background-color: rgba(16, 185, 129, 0.1);
  color: #047857;
}

.tag-info {
  background-color: rgba(59, 130, 246, 0.1);
  color: #1d4ed8;
}

.tag-warning {
  background-color: rgba(245, 158, 11, 0.1);
  color: #d97706;
}

.tag-danger {
  background-color: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
}

/* 进度条样式 */
.progress {
  height: 0.5rem;
  background-color: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  transition: width 0.3s ease;
  border-radius: 9999px;
}

/* 情报源卡片样式 */
.source-card {
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid #e2e8f0;
  background-color: rgba(255, 255, 255, 0.9);
}

.source-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.source-card-header {
  padding: 1rem;
  border-bottom: 1px solid #f1f5f9;
}

.source-card-body {
  padding: 1rem;
}

.source-card-footer {
  padding: 0.75rem 1rem;
  background-color: #f8fafc;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 评分显示样式 */
.score-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.875rem;
}

.score-excellent {
  background-color: rgba(16, 185, 129, 0.1);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.score-good {
  background-color: rgba(59, 130, 246, 0.1);
  color: #1d4ed8;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.score-normal {
  background-color: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.score-warning {
  background-color: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* 侧边栏样式 */
.sidebar {
  height: 100%;
  overflow-y: auto;
}

.sidebar-nav-item {
  transition: all 0.2s ease;
  position: relative;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  cursor: pointer;
}

.sidebar-nav-item:hover {
  background-color: #f1f5f9;
}

.sidebar-nav-item.active {
  background-color: rgba(59, 130, 246, 0.1);
  color: #1d4ed8;
  font-weight: 500;
}

.sidebar-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background-color: #3b82f6;
  border-radius: 0 4px 4px 0;
}

/* 面板样式 */
.panel {
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.panel-header {
  padding: 1rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-body {
  padding: 1rem;
}

/* 选项卡样式 */
.tabs {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 1rem;
}

.tab {
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
  color: #64748b;
}

.tab:hover {
  color: #334155;
}

.tab.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
  font-weight: 500;
}

/* 开关样式 */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.3s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #3b82f6;
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* 滑动条样式 */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #e2e8f0;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
  transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 0 8px rgba(59, 130, 246, 0.1);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 0 8px rgba(59, 130, 246, 0.1);
}

/* 动画效果 */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

/* 响应式调整 */
@media (max-width: 1280px) {
  .xl\:grid-cols-4 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1024px) {
  .lg\:flex-row {
    flex-direction: column;
  }
  
  .lg\:w-64,
  .lg\:w-72 {
    width: 100%;
    margin-bottom: 1rem;
  }
  
  .lg\:grid-cols-3,
  .xl\:grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* 导航栏优化 */
  .nav-links {
    gap: 0.5rem;
  }
  
  .nav-links a {
    padding: 0.5rem;
    font-size: 0.875rem;
  }
}

@media (max-width: 768px) {
  /* 平板设备优化 */
  .card {
    margin-bottom: 1rem;
  }
  
  .modal-content {
    width: 90% !important;
    max-width: 500px;
    margin: 1rem;
  }
  
  .filter-container {
    flex-direction: column;
    gap: 1rem;
  }
}

@media (max-width: 640px) {
  /* 移动设备优化 */
  .md\:grid-cols-2,
  .lg\:grid-cols-3,
  .xl\:grid-cols-4 {
    grid-template-columns: 1fr;
  }
  
  .flex-wrap {
    flex-direction: column;
    gap: 1rem !important;
  }
  
  .header .flex {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }
  
  .w-64 {
    width: 100%;
  }
  
  /* 移动导航栏优化 */
  .nav-container {
    padding: 0.75rem;
  }
  
  .nav-title {
    font-size: 1.25rem;
  }
  
  .nav-links {
    justify-content: space-around;
  }
  
  /* 移动设备按钮优化 */
  .btn {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    width: 100%;
  }
  
  /* 移动设备输入框优化 */
  .input,
  select {
    padding: 0.75rem;
    font-size: 1rem;
  }
  
  /* 移动设备模态框优化 */
  .modal {
    padding: 1rem;
  }
  
  .modal-content {
    width: 100% !important;
    margin: 0;
    max-height: 90vh;
    overflow-y: auto;
  }
  
  /* 移动设备表格优化 */
  table {
    font-size: 0.875rem;
  }
  
  /* 移动设备卡片优化 */
  .card {
    padding: 1rem;
    margin-bottom: 1rem;
  }
}

/* 可访问性增强 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
  .card {
    border-width: 2px;
    border-color: currentColor;
  }
  
  .btn {
    border-width: 2px;
  }
}

/* 工具提示样式 */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 200px;
  background-color: #334155;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 8px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -100px;
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 0.875rem;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* 高亮效果 */
.highlight {
  background-color: rgba(59, 130, 246, 0.15);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
}

/* 分隔线样式 */
.divider {
  height: 1px;
  background-color: #e2e8f0;
  margin: 1rem 0;
}

/* 加载状态样式 */
.loading {
  width: 32px;
  height: 32px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* 全局加载指示器样式 */
#global-loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.3);
  z-index: 50;
  backdrop-filter: blur(2px);
}

#global-loading.hidden {
  display: none;
}

#global-loading > div {
  background-color: white;
  padding: 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1rem;
  font-weight: 500;
  color: #333;
}

/* 聚焦状态样式 */
.source-card.focused {
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.3);
  transform: translateY(-2px);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}